class Animals{
    public String name;
    public int age;

    public Animals eat(){
        return
    }
    public Animals(String name){
        this.name = name;
        System.out.println("Animals(String)");
    }
    public Animals(String name,int age){
        this.name = name;
        this.age = age;
        System.out.println("Animals(String,int)");
    }
}
public class Dog extends Animals {
    public boolean silly;
   
    public Dog(boolean silly){
        super("小黑",10);
        this.silly = silly;
        System.out.println("Dog()");
    }

    public Dog(String name,int age,boolean silly){
        //先帮助从父类继承的成员变量赋值,必须放在第一行
        super(name,age);
        this.silly = silly;
        System.out.println("Dog(String,int,boolean)");
    }
    @Override
    public String toString() {
        return   name+" "+age+" "+silly;

    }

    public static void main(String[] args) {
        Dog dog = new Dog(true);
        //dog.name = "小灰";//
        System.out.println(dog);
        Dog dog2 = new Dog("大黄",12,true);

        System.out.println(dog2);
    }
}
